home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / tex / mf / inputs / test / newzm.mf < prev    next >
Text File  |  1993-11-28  |  2KB  |  93 lines

  1. % font parameters
  2.  
  3. % abcdefghijklmnopqrstuvwxy          used
  4. %         zABCDEFGHIJKLMNOPQRSTUVWXYZ    available
  5.  
  6. mode_setup;
  7.  
  8.  
  9. def flipy(expr x) = 
  10.     begingroup save T; transform T;
  11.     T  = identity xscaled -1 shifted (2x, 0);
  12.     T endgroup enddef;
  13.  
  14. height# := 8pt#;
  15. penwidth# := .5pt#;
  16.  
  17. hooklength# := 2pt#;
  18. margin# := 1pt#;
  19.  
  20. define_corrected_pixels(penwidth);
  21. define_pixels(height, hooklength, margin);
  22.  
  23. picture p;
  24.  
  25. beginchar("8", 2margin# + penwidth# + hooklength#, height#, 0);
  26. pickup pencircle scaled penwidth;
  27. bot z1 = (margin, 0);
  28. top z2 = (margin, height);
  29. z3 = z2 + (hooklength, -hooklength);
  30. draw z1 -- z2;
  31. draw z2 {down} .. {right} z3;
  32. penlabels(1,2,3);
  33. p := currentpicture;
  34. endchar;
  35.  
  36.  
  37. beginchar("9", 2margin# + penwidth# + hooklength#, height#, 0);
  38. numeric u;
  39. u = (2margin + penwidth + hooklength)/2;
  40. currentpicture := p transformed flipy(u);
  41. endchar;
  42.  
  43. % circle, box, diamond    (l)
  44.  
  45. pen_width# := 1pt#;
  46. sq_width# := 8pt#;
  47. h_width# := sq_width / 2;
  48. margin# := 1pt#;
  49. bottom# := -1pt#;
  50.  
  51. define_pixels(sq_width, h_width, margin, bottom);
  52. define_corrected_pixels(pen_width);
  53.  
  54.  
  55. beginchar("0", sq_width# + 2margin#, sq_width#-bottom#, -bottom#);
  56. % pickup pensquare scaled pen_width;
  57. pickup pencircle scaled pen_width;
  58. bot lft z1 = (margin, bottom);    % 4  3
  59. bot rt z2 = (margin + sq_width, bottom);% 1  2
  60. top rt z3 = (margin + sq_width, sq_width + bottom);
  61. top lft z4 = (margin, sq_width + bottom);
  62.  
  63. draw z1 -- z2 -- z3 -- z4 -- z1;
  64. penlabels(1,2,3,4);
  65. endchar;
  66.  
  67. beginchar("1", sq_width#+ 2margin#, sq_width#-bottom#, -bottom#);
  68. %pen p;
  69. %p = pencircle;
  70. %pickup p scaled pen_width;
  71. pickup pencircle scaled pen_width;
  72. bot z1 = (margin + sq_width/2, bottom);    %    3
  73. top z3 = bot z1 + sq_width * up;    % 4  2
  74. lft z4 = (margin, sq_width/2 + bottom );  %    1
  75. rt z2 = lft z4 + sq_width * right;
  76. draw z1 -- z2 -- z3 -- z4 -- z1;
  77. penlabels(1,2,3,4);
  78. endchar;
  79.  
  80.  
  81. beginchar("2", sq_width#+ 2margin#, sq_width#-bottom#, -bottom#);
  82. pickup pencircle scaled pen_width;
  83. bot z1 = (margin + sq_width/2, bottom);    %    3
  84. top z3 = bot z1 + sq_width * up;    % 4  2
  85. lft z4 = (margin, sq_width/2 + bottom );  %    1
  86. rt z2 = lft z4 + sq_width * right;
  87. draw z1{right} .. z2{up} .. z3{left} ..  z4{down} .. cycle;
  88. penlabels(1,2,3,4);
  89. endchar;
  90.  
  91.  
  92. end
  93.